<template>
    <lightning-card icon-name="standard:case" title={headerText}>
        <template lwc:if={isLoading}>
            <lightning-spinner></lightning-spinner>
        </template>
        <template lwc:if={viewMode}>
            <lightning-button lwc:if={canEdit} label="Edit" slot="actions" onclick={editClick}></lightning-button>
            <lightning-button lwc:if={canSubmit} label="Submit" slot="actions" onclick={submitClick}></lightning-button>
            <lightning-button lwc:if={canAccept} label="Accept" slot="actions" onclick={acceptClick}></lightning-button>
        </template>
        <lightning-record-form object-api-name='Case' record-id={recordId} fields={fields} mode={mode} class="slds-m-horizontal_small" onload={formLoad}></lightning-record-form>
    </lightning-card>
</template>